#!/bin/sh

# linux、mac上打包的脚本
mvn clean install -Dmaven.test.skip=true
# del example-dist
rm -rf dist

# create example-dist
mkdir dist
mkdir dist/plugins
mkdir dist/pluginConfig

# copy main program and config
cp integration-main/target/*-exec.jar dist
cp integration-main\src\main\resources\application-prod.yml dist

#cp plugins/integration-recognition-plugin/target/*-jar-with-dependencies.jar dist/plugins
#cp plugins/integration-recognition-plugin/src/main/resources/plugin1.yml dist/pluginConfig

#cp plugins/integration-wxapp-plugin/target/*-jar-with-dependencies.jar dist/plugins
#cp plugins/integration-wxapp-plugin/src/main/resources/plugin2.yml dist/pluginConfig

cd dist

#run main
mv *-exec.jar integration-mybatisplus-start.jar
mv application-prod.yml application.yml
java -jar integration-mybatisplus-start.jar --spring.config.location=application.yml


touch consoleMsg.log
nohup java -jar integration-mybatisplus-start.jar --spring.config.location=application.yml > consoleMsg.log 2>&1 &
tail -f -n 500 consoleMsg.log

